refactor: unify Dijkstra on efficient PriorityQueue implementation#7486
Open
priyanshuvishwakarma273403 wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7486 +/- ##
============================================
- Coverage 79.86% 79.85% -0.02%
+ Complexity 7333 7321 -12
============================================
Files 808 807 -1
Lines 23833 23813 -20
Branches 4690 4686 -4
============================================
- Hits 19035 19016 -19
Misses 4036 4036
+ Partials 762 761 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR unifies the Dijkstra implementation under
datastructures/graphs/to use a single, efficient, priority-queue-based (using Java'sPriorityQueuewith lazy updates) implementation. It removes the redundantDijkstraOptimizedAlgorithmclass.Related Issue
Fixes #7458
Changes Made
DijkstraAlgorithm.javato use aPriorityQueuewithNodehelper class.DijkstraOptimizedAlgorithm.javaandDijkstraOptimizedAlgorithmTest.java.DijkstraAlgorithmTest.javarun and pass successfully.Checklist